package com.globallogic.jira.gadget.servlet;

public interface Scripts {

	public static final String NODE_REFRESH_SCRIPT = "<script>"
			+ "jQuery.get('/plugins/servlet/gadgets/treebuilderservlet', 'issue_key=ISSUE_KEY&is_node=true',"
			+ "function(data){" + "$('#ELEMENT_ID').html('');"
			+ "$('#ELEMENT_ID').append(data);" + "},'html');" + "</script>";

	public static final String BRANCH_REFRESH_SCRIPT = "<script>"
			+ "jQuery.get('/plugins/servlet/gadgets/treebuilderservlet','issue_key=ISSUE_KEY&is_node=true&is_branch=true',"
			+ "function(data){"
			+ "if ($('#ELEMENT_ID').parent().children('ul').length>0)" + "{"
			+ "$('#ELEMENT_ID').parent().children('ul').append(data);" + "}"
			+ "else " + "{"
			+ "$('#ELEMENT_ID').parent().append('<ul>'+data+'</ul>')" + "}"
			+ "},'html');" + "</script>";

	public static final String TREE_REFRESH_SCRIPT = "<script>executeAjaxCall();</script>";

}
